/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : main.h
  * @brief          : Header for main.c file.
  *                   This file contains the common defines of the application.
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; Copyright (c) 2020 STMicroelectronics.
  * All rights reserved.</center></h2>
  *
  * This software component is licensed by ST under BSD 3-Clause license,
  * the "License"; You may not use this file except in compliance with the
  * License. You may obtain a copy of the License at:
  *                        opensource.org/licenses/BSD-3-Clause
  *
  ******************************************************************************
  */
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32f1xx_ll_adc.h"
#include "stm32f1xx_ll_dma.h"
#include "stm32f1xx_ll_i2c.h"
#include "stm32f1xx_ll_rcc.h"
#include "stm32f1xx_ll_bus.h"
#include "stm32f1xx_ll_system.h"
#include "stm32f1xx_ll_exti.h"
#include "stm32f1xx_ll_cortex.h"
#include "stm32f1xx_ll_utils.h"
#include "stm32f1xx_ll_pwr.h"
#include "stm32f1xx_ll_spi.h"
#include "stm32f1xx_ll_tim.h"
#include "stm32f1xx.h"
#include "stm32f1xx_ll_gpio.h"

#if defined(USE_FULL_ASSERT)
#include "stm32_assert.h"
#endif /* USE_FULL_ASSERT */

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "solder.h"
#include "display.h"

#include "u8g2.h"
#include "u8g2_graphics_test.h"
#include "u8g2_rotation_test.h"

/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */

/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */

/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */

/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);

/* USER CODE BEGIN EFP */

/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/
#define VFD_RST_Pin LL_GPIO_PIN_13
#define VFD_RST_GPIO_Port GPIOC
#define Suck_Button_in_Pin LL_GPIO_PIN_14
#define Suck_Button_in_GPIO_Port GPIOC
#define Iron_Change_in_Pin LL_GPIO_PIN_15
#define Iron_Change_in_GPIO_Port GPIOC
#define Solder_Ctrl_Pin LL_GPIO_PIN_0
#define Solder_Ctrl_GPIO_Port GPIOD
#define Fan_Mon_Pin LL_GPIO_PIN_1
#define Fan_Mon_GPIO_Port GPIOD
#define Vin_AD_Pin LL_GPIO_PIN_0
#define Vin_AD_GPIO_Port GPIOA
#define zero__Pin LL_GPIO_PIN_1
#define zero__GPIO_Port GPIOA
#define zero__EXTI_IRQn EXTI1_IRQn
#define NTC_Pin LL_GPIO_PIN_2
#define NTC_GPIO_Port GPIOA
#define Current_Pin LL_GPIO_PIN_3
#define Current_GPIO_Port GPIOA
#define SOLDER_THERM_Pin LL_GPIO_PIN_4
#define SOLDER_THERM_GPIO_Port GPIOA
#define LED_Ctrl_Pin LL_GPIO_PIN_5
#define LED_Ctrl_GPIO_Port GPIOA
#define IRON_CTRL_Pin LL_GPIO_PIN_6
#define IRON_CTRL_GPIO_Port GPIOA
#define Beep_Pin LL_GPIO_PIN_7
#define Beep_GPIO_Port GPIOA
#define EN1_A_Pin LL_GPIO_PIN_0
#define EN1_A_GPIO_Port GPIOB
#define EN1_B_Pin LL_GPIO_PIN_1
#define EN1_B_GPIO_Port GPIOB
#define KEY1_Pin LL_GPIO_PIN_2
#define KEY1_GPIO_Port GPIOB
#define KEY2_Pin LL_GPIO_PIN_10
#define KEY2_GPIO_Port GPIOB
#define EN_9016_Pin LL_GPIO_PIN_11
#define EN_9016_GPIO_Port GPIOB
#define VFD_CS_Pin LL_GPIO_PIN_12
#define VFD_CS_GPIO_Port GPIOB
#define SCK_Pin LL_GPIO_PIN_13
#define SCK_GPIO_Port GPIOB
#define MISO_Pin LL_GPIO_PIN_14
#define MISO_GPIO_Port GPIOB
#define MOSI_Pin LL_GPIO_PIN_15
#define MOSI_GPIO_Port GPIOB
#define LED1_Pin LL_GPIO_PIN_8
#define LED1_GPIO_Port GPIOA
#define SYNC_Pin LL_GPIO_PIN_11
#define SYNC_GPIO_Port GPIOA
#define Flash_CS_Pin LL_GPIO_PIN_12
#define Flash_CS_GPIO_Port GPIOA
#define Sleep_Sen_Pin LL_GPIO_PIN_15
#define Sleep_Sen_GPIO_Port GPIOA
#define EN2_A_Pin LL_GPIO_PIN_6
#define EN2_A_GPIO_Port GPIOB
#define EN2_B_Pin LL_GPIO_PIN_7
#define EN2_B_GPIO_Port GPIOB
#define SCL_Pin LL_GPIO_PIN_8
#define SCL_GPIO_Port GPIOB
#define SDA_Pin LL_GPIO_PIN_9
#define SDA_GPIO_Port GPIOB
#ifndef NVIC_PRIORITYGROUP_0
#define NVIC_PRIORITYGROUP_0         ((uint32_t)0x00000007) /*!< 0 bit  for pre-emption priority,
                                                                 4 bits for subpriority */
#define NVIC_PRIORITYGROUP_1         ((uint32_t)0x00000006) /*!< 1 bit  for pre-emption priority,
                                                                 3 bits for subpriority */
#define NVIC_PRIORITYGROUP_2         ((uint32_t)0x00000005) /*!< 2 bits for pre-emption priority,
                                                                 2 bits for subpriority */
#define NVIC_PRIORITYGROUP_3         ((uint32_t)0x00000004) /*!< 3 bits for pre-emption priority,
                                                                 1 bit  for subpriority */
#define NVIC_PRIORITYGROUP_4         ((uint32_t)0x00000003) /*!< 4 bits for pre-emption priority,
                                                                 0 bit  for subpriority */
#endif
/* USER CODE BEGIN Private defines */

#define TOGGLE_LED()    LL_GPIO_TogglePin(LED1_GPIO_Port, LED1_Pin)
#define TURN_ON_LED()   LL_GPIO_SetOutputPin(LED1_GPIO_Port, LED1_Pin)
#define TURN_OFF_LED()  LL_GPIO_ResetOutputPin(LED1_GPIO_Port, LED1_Pin)

#define EN9016_EN()     LL_GPIO_SetOutputPin(EN_9016_GPIO_Port, EN_9016_Pin)
#define EN9016_DIS()    LL_GPIO_ResetOutputPin(EN_9016_GPIO_Port, EN_9016_Pin)

/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
